package Chapter6.dao;

import org.hibernate.HibernateException;

import Chapter6.entity.Sample;

import learnning.dao.base.HibernateDao;

public class SampleDao extends HibernateDao {
	public void addSample(String title) {
		try {
			begin();
			Sample sample = new Sample(title);
			getSession().save(sample);
			commit();
		} catch (HibernateException e) {
			rollback();
			e.printStackTrace();
		}
	}
}
